package vehialpes.canonico.transformadores;

import java.util.ArrayList;
import java.util.Collection;

import org.mule.api.transformer.TransformerException;
import org.mule.transformer.AbstractTransformer;

import vehialpes.canonico.clases.TallerCanonico;
import vehialpes.listarTalleres.Taller;

public class TalleresToCanonico extends AbstractTransformer {

	@Override
	protected Object doTransform(Object arg0, String arg1)
			throws TransformerException {
		Collection<Taller> input = (Collection<Taller>)arg0;
		Collection<TallerCanonico> output = new ArrayList<TallerCanonico>();
		
		for (Taller taller : input) {
			TallerCanonico tc = new TallerCanonico();
			tc.setCalificacion(taller.getCalificacion());
			tc.setUbicacion(taller.getUbicacion());
			tc.setNombre(taller.getNombre());
			tc.setNit(taller.getNit());
			output.add(tc);
		}
		
		return output;
	}

}
